<?php // configuração dos elemento html
$readonly       = '';
$status         = TRUE;
$btn_submit     = TRUE;
$btn_voltar     = TRUE;

if($this->view == 'view'){
    $readonly   = 'readonly=""'; 
    $status     = FALSE;
    $btn_submit = FALSE;
}else {
    $readonly   = 'readonly=""'; 
}

?>
<div class="content-form">
    <h2><?php echo $this->titulo; ?></h2>
    <div id="content-form">
        <form id="form_pdr" action="" method="post" enctype="application/x-www-form-urlencoded">    
            <input type="hidden" id="INT_ID" name="INT_ID" value="<?php echo $this->data['INT_ID']; ?>" />
                
            <div class="col">
                <div class="ln"><strong>Nome</strong> <input type="text" id="INT_NOM" name="INT_NOM" value="<?php echo $this->data['INT_NOM']; ?>" <?php echo $readonly; ?>/></div>
                <div class="ln"><strong>E-mail</strong> <input type="text" id="INT_EML" name="INT_EML" value="<?php echo $this->data['INT_EML']; ?>" <?php echo $readonly; ?>/></div>
                <div class="ln"><strong>Telefone</strong> <input type="text" id="INT_TEL" name="INT_TEL" value="<?php echo $this->data['INT_TEL']; ?>" <?php echo $readonly; ?>/></div>
                <div class="ln"><strong>Cidade</strong> <input type="text" id="INT_CID" name="INT_CID" value="<?php echo $this->data['INT_CID']; ?>" <?php echo $readonly; ?>/></div>
                <div class="ln"><strong>Data</strong> <input type="text" id="INT_DAT" name="INT_DAT" value="<?php echo $this->data['INT_DAT']; ?>" <?php echo $readonly; ?> /></div>
                <div class="ln"><strong>Curso</strong> <input type="text" id="CBS_NOM" name="CBS_NOM" value="<?php echo $this->curso['CBS_NOM']; ?>" <?php echo $readonly; ?> /></div>
                
                <div class="ln"><strong>Horarios</strong> 
                    <table style="margin: -18px 0px 0px 95px;">
                <?php foreach($this->horarios as $hor) { ?>
                        <tr>
                            <td><?php echo Datetools::semana($hor['NRT_SEM'],2).' '.substr($hor['NRT_HOR'],0,5); ?></td>
                        </tr>
                <?php } ?>
                    </table>
                </div>
                
                <div class="ln"><strong>Descrição Contato</strong> 
                    <textarea name="INT_DESCNT"><?php echo $this->data['INT_DESCNT']; ?></textarea>
                </div>
                
                <div class="ln"><strong>Status Contato</strong> 
                    <select name="INT_STACNT">
                <?php
                    $stacnt = dominio::statusInteresse();
                    foreach($stacnt as $key => $sta) { 
                        $select = $this->data['INT_STACNT'] == $key ? 'selected=""':''; 
                ?>
                        <option value="<?php echo $key; ?>" <?php echo $select; ?> ><?php echo $sta; ?></option>
                <?php } ?>
                    </select>
                </div>
                
                <?php if($status){?>
                <div class="ln"><strong>Status</strong> <br>
                    <label><input type="radio" name="INT_STA" id="INT_STA" value="1" class="tpotmp" <?php if($this->data['INT_STA'] == 1 || empty($this->data['INT_STA'])) echo 'checked=""'; ?>> Ativo</label> &nbsp;
                    <label><input type="radio" name="INT_STA" id="INT_STA" value="0" class="tpotmp" <?php if($this->data['INT_STA'] == '0') echo 'checked=""'; ?> > Inativo</label>
                </div>
                <?php } ?>
                
                <div>
                    <?php if($btn_submit){?><input type="submit" name="submit" id="submitbutton" value="Salvar" class="btn-frm"><?php } ?>
                    <?php if($btn_voltar){?><a href="<?php echo $this->urlmodulo.'/'.$this->controller; ?>" class="btn-frm">voltar</a><?php } ?>
                </div>
                
            </div>
        </form>
    </div>
</div>

<style>.col{ width: 450px; } .col strong { width: 115px; }</style>